package ex4; public class Main { public static void main(String args[]) { Address a = new Address(); Dao.save(a); a.setZip(null); Dao.save(a); a.setZip("75001"); Dao.save(a); Dao.save(a); } }
package ex4; public class Dao { public static void save(Object o) { if (o != null) { System.out.printf("Saving: %s\n", o.getClass()); } } }
You need to enable Javascript in your browser to edit pages.
help on how to format text
Predict the Output
Source files are here:Have a look at the following Java files and, as before, predict the output.
Main.java
Dao.java
Address.java
Address is unchanged from the previous example. It is a simple Java Bean style class with setters and getters.Assignment: Predict the Output
Please take a few moments to predict the output before moving on.<--Back Next-->